package com.innerex.inexclear.core.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.innerex.inexclear.core.dao.ClearingTransactionDao;
import com.innerex.inexclear.core.model.ClearingTransaction;
import com.innerex.inexclear.core.service.ClearingTransactionManager;

@Service("tradingTransactionManager")
public class ClearingTransactionManagerImpl extends
		GenericManagerImpl<ClearingTransaction, Long> implements
		ClearingTransactionManager {

	ClearingTransactionDao clearingTransactionDao;

	@Autowired
	public ClearingTransactionManagerImpl(
			ClearingTransactionDao clearingTransactionDao) {
		super(clearingTransactionDao);
		this.clearingTransactionDao = clearingTransactionDao;
	}

	public List<ClearingTransaction> getClearingTransactions() {
		return clearingTransactionDao.getAllDistinct();
	}

	public ClearingTransaction saveClearingTransaction(
			ClearingTransaction clearingTransaction) {
		// TODO perform some checks
		return clearingTransactionDao.save(clearingTransaction);
	}
}
